﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for Comment
/// </summary>
public class Comment : IComparable<Comment>
{
    public Comment()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    private string _Id;

    public string Id
    {
        get { return _Id; }
        set { _Id = value; }
    }
    private string _Comment;

    public string CommentData
    {
        get { return _Comment; }
        set { _Comment = value; }
    }
    private DateTime _DateEntered;

    public DateTime DateEntered
    {
        get { return _DateEntered; }
        set { _DateEntered = value; }
    }



    public int CompareTo(Comment other)
    {
        if (this.DateEntered < other.DateEntered) return 1;
        else
            if (this.DateEntered > other.DateEntered) return -1;
            else
                return 0;
    }



}


public class SortByCommentData : IComparer<Comment>
{


    public int Compare(Comment x, Comment y)
    {
        return string.Compare(x.CommentData, y.CommentData);
    }

}

public class SortByCommentDataRev : IComparer<Comment>
{


    public int Compare(Comment y, Comment x)
    {
        return string.Compare(x.CommentData, y.CommentData);
    }


}

public class SortByDate : IComparer<Comment>
{


    public int Compare(Comment x, Comment y)
    {
        return DateTime.Compare(x.DateEntered, y.DateEntered);
    }


}